﻿using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace Witt.AspNetCore.JMeter
{
    public static class JMeterMiddlewares
    {
        public static void AddJMeter(this IServiceCollection services) => AddJMeter(services, configure: (options) => { });

        public static void AddJMeter(this IServiceCollection services, Action<JMeterOptions> configure)
        {
            services.Configure(configure);
        }

        public static void UseJMeter(this IApplicationBuilder app)
        {
            app.UseMiddleware<ScriptMiddleware>();
        }
    }
}
